<script setup>
/**
 * 
 */
import { ref } from 'vue'

const items = ref([
    {message:'Foo'},
    {message:'Bar'}
])
const parentMessage = ref('Parent')

</script>

<template>
<li v-for="(item,index) in items">
    {{ parentMessage }} - {{ index }} - {{ item.message }}
</li>

<li v-for="{ message } in items">
  {{ message }}
</li>

<!-- 有 index 索引时 -->
<li v-for="({ message }, index) in items">
  {{ message }} {{ index }}
</li>


</template>

<style scoped>

</style>